import { defineStore } from "pinia";
import notePad from "@/application/notePad";
import launchPad from "@/application/lauchPad";
import netEaseMusic from "@/application/netEasyMusic";
export default defineStore({
    id:'main',
    state: (): {[key:string]:any} => ({
        applications:{
            notePad:{
                logo:'https://s6.bihukankan.com/img/1647408727notePad.png',
                version: '1.0.0',
                name:'记事本',
                run: notePad.run
            },
            launchPad:{
                logo:'https://s6.bihukankan.com/img/16485311351.png',
                version: '1.0.0',
                name:'启动台',
                run: launchPad.run
            },
            netEasyMusic:{
                logo:'https://s6.bihukankan.com/img/1648877740cbbcc9ef1610ebd042edf38d9b63d482.png',
                version: '1.0.0',
                name:'网易云音乐',
                run: netEaseMusic.run
            }
        }
    }),
    actions:{
        updateCount(){
            this.count += 30
        },
        getApplication(id:string){
            const appId = id.split('-@')[0]
            return this.applications[appId]
        }
    },
})()
